using logging;

class Igniter{  // 火花塞，用于燃烧
    public (bool, bool) bomb(){
        Log.print("压缩，点爆，燃烧，奔跑吧摩托！");
        var hasGasoline = false;
        var hasCombustion = true;
        return (hasGasoline, hasCombustion);
    }
}

class SingleCylinderEngine{
    private bool hasGasoline = false;  // {get;set;}
    private bool hasCombustion = false;  // {get;set;}
    private Igniter ignitor = new Igniter();

    public void run(){
        this.suction_stroke();
        this.compression_stroke();
        this.exhaust_stroke();
    }
    private void suction_stroke(){  // 进气冲程：填料
        if(hasGasoline)
            Log.print("还有油呢...");
        else
            hasGasoline = true;  // 加油
    }
    private void compression_stroke(){  // 压缩冲程：燃烧
        if(!hasGasoline)
            Log.print("没油了，跑个啥...");
        else if(hasCombustion)
            Log.print("刚燃完，下一爆...");
        else
            (hasGasoline, hasCombustion) = ignitor.bomb();
    }
    private void exhaust_stroke(){  // 排气冲程：换气
        if(!hasCombustion)
            Log.print("还没燃烧呢，排啥气，败家...");
        else
            hasCombustion = false;  // 排气
    }
}

class Demo{
    static void Main(){
        var motor = new SingleCylinderEngine();
        for(int i=0; i<5; i++){
            motor.run();
        }
    }
}